Magnetic position sensor system, method and device with error detection

ABSTRACT

Method of determining a position of a sensor device relative to a magnetic source, includes: a) determining a first and a second magnetic field component at a first sensor location; b) determining a third and a fourth magnetic field component at a second sensor location; c) determining a first difference of the first and third component, and determining a second difference of the second and fourth component, and determining a first angle based on a ratio of the first and second difference; d) determining a first sum of the first and third component, and determining a second sum of the second and fourth component; e) determining a second angle based on a ratio of said first and second sum; f) comparing the first and second angle to detect error.

FIELD OF THE INVENTION

The present invention relates in general to the field of magneticposition sensor systems, devices and methods, and more in particular tolinear and/or angular magnetic position sensor systems and devices witherror detection capabilities, and methods of determining a linear orangular position and detecting if an error has occurred.

BACKGROUND OF THE INVENTION

Magnetic sensor systems, in particular linear or angular position sensorsystems are known in the art. They offer the advantage of being able tomeasure a linear or angular position without making physical contact,thus avoiding problems of mechanical wear, scratches, friction, etc.

Many variants of position sensor systems exist, addressing one or moreof the following requirements: using a simple or cheap magneticstructure, using a simple or cheap sensor device, being able to measureover a relatively large range, being able to measure with greataccuracy, requiring only simple arithmetic, being able to measure athigh speed, being highly robust against positioning errors, being highlyrobust against an external disturbance field, providing redundancy,being able to detect an error, being able to detect and correct anerror, having a good signal-to-noise ratio (SNR), etc.

Often two or more of these requirements conflict with each other, hencea trade-off needs to be made.

EP3783316(A1) discloses magnetic position sensor systems comprising amagnet or a magnetic structure, and a sensor device movably mountedrelative to said magnet or magnetic structure. The systems described inthis document, however, do not have error detection capabilities.

There is always room for improvements or alternatives.

SUMMARY OF THE INVENTION

It is an object of embodiments of the present invention to provide amagnetic position sensor system capable of determining a position of asensor device relative to a magnet or a magnetic structure, and capableof detecting an error, (e.g. an error related to a defective sensor ortransducer).

It is also an object of embodiments of the present invention to providea sensor device specifically adapted for use in such a system.

It is also an object of embodiments of the present invention to providea method of determining a position of a sensor device relative to amagnet or a magnetic structure, and to provide additional informationindicative of an error, and/or allowing the detection of an error byanother processor connected to the sensor device.

It is an object of embodiments of the present invention to provide sucha system, device and method, wherein the position is determined in amanner which is highly insensitive to an external disturbance field(also known as “stray field”).

These objectives are accomplished by embodiments of the presentinvention.

According to a first aspect, the present invention provides a positionsensor device comprising: a first sensor configured for determining afirst magnetic field component (e.g. Bx1) and a second magnetic fieldcomponent (e.g. By1 or Bz1) at a first sensor location, the firstmagnetic field component oriented in a first direction (e.g. X), thesecond magnetic field component oriented in a second direction (e.g. Yor Z) perpendicular to the first direction; and a second sensorconfigured for determining a third magnetic field component (e.g. Bx2)and a fourth magnetic field component (e.g. By2 or Bz2) at a secondsensor location spaced from the first sensor location, the thirdmagnetic field component oriented in the first direction, the fourthmagnetic field component oriented in the second direction; a processingunit connected to the first sensor and to the second sensor, andconfigured for determining a first difference (e.g. ΔBx) between thefirst and the third magnetic field component, and for determining asecond difference (e.g. ΔBy or ΔBz) between the second and the fourthmagnetic field component, and for determining a first angle (e.g. θ1)based on a ratio of the first and second difference, and for outputtingthe first angle; wherein the processing unit is further configured forperforming one of the following: i) determining a first sum (e.g. ΣBx)of the first and the third magnetic field component, and determining asecond sum (e.g. ΣBy or ΣBz) of the second and the fourth magnetic fieldcomponent, and outputting the first sum and the second sum for allowingan external processor to determine a second angle (e.g. θ2) and tocompare the first and second angle in order to detect an error; ii)determining a first sum (e.g. ΣBx) of the first and the third magneticfield component, and determining a second sum (e.g. ΣBy or ΣBz) of thesecond and the fourth magnetic field component, and determining a secondangle (e.g. θ2) based on a ratio of the first sum and the second sum,and outputting the second angle for allowing an external processor tocompare the first and second angle in order to detect an error; iii)determining a first sum (e.g. ΣBx) of the first and the third magneticfield component, and determining a second sum (e.g. By or ΣBz) of thesecond and the fourth magnetic field component, and determining a secondangle (e.g. θ2) based on a ratio of the first sum and the second sum,and comparing the first angle and the second angle, and outputting adiagnostic signal based on a result of the comparison.

It is an advantage that the first angle (also referred to herein as“main angle”) is calculated based on a ratio of two difference signals(or gradients), because this first angle is highly robust against anexternal disturbance field (also known as “strayfield”).

It is an advantage of this sensor system that a second angle iscalculated based on a ratio of two sum signals, because a comparison ofthe first and second angle allows to detect an error, e.g. a defect ofone of the sensor elements. The inventors surprisingly found that such acomparison is very well feasible, even in the presence of an externaldisturbance field.

In an embodiment, the first sensor comprises a first integrated magneticconcentrator and a first and a second horizontal Hall element arrangedon opposite sides of the first IMC; and the second sensor comprises asecond integrated magnetic concentrator and a third and a fourthhorizontal Hall element arranged on opposite sides of the second IMC.

Examples of such position sensor device are shown in FIG. 3(c), FIG.3(d), FIG. 4(c), FIG. 5(d), FIG. 5(e). The first and second sensor maybe spaced apart by 1.0 mm to 3.0 mm.

In some of these embodiments, the position sensor device comprises twoIMC with only two horizontal Hall elements each, thus only fourhorizontal Hall elements in total, e.g. as illustrated in FIG. 3(c) andFIG. 5(d). It is an advantage of these embodiments that diagnosticfunctionality is provided without increasing the number of sensorelements.

In an embodiment, the first sensor further comprises a fifth and a sixthhorizontal Hall element which are 90° spaced from the first and secondhorizontal Hall element; and the second sensor further comprises aseventh and an eighth horizontal Hall element which are 90° spaced fromthe third and fourth horizontal Hall element.

Examples of such position sensor device are shown in FIG. 3(d), FIG.4(c), FIG. 5(e).

In an embodiment, the second magnetic field component (By1) and thefourth magnetic field component (By2) are oriented in the Y direction,parallel to the semiconductor substrate, e.g. as illustrated in FIG.4(c).

In an embodiment, the second magnetic field component (Bz1) and thefourth magnetic field component (Bz2) are oriented in the Z direction,perpendicular to the semiconductor substrate, e.g. as illustrated inFIG. 3(d) and FIG. 5(e). The second and the fourth magnetic fieldcomponent may be determined based on signals obtained from the Hallelements which are not located on the X axis, i.e. based on the signalsh3, h4, h7, h8 of FIG. 3(d) and FIG. 5(e)

In an embodiment, the first sensor comprises a first horizontal Hallelement and a first vertical Hall element; and the second sensorcomprises a second horizontal Hall element and a second vertical Hallelement.

Examples of such position sensor device are shown in FIG. 3(e), and FIG.5(f). Preferably in this case, the position sensor device does notcomprise integrated magnetic concentrators. It is an advantage of theseembodiments that diagnostic functionality is provided without increasingthe number of sensor elements. The vertical Hall elements may have adirection of maximum sensitivity oriented in the first direction (X).

In an embodiment, the first sensor comprises a first and a secondvertical Hall element; and the second sensor comprises a third and afourth vertical Hall element.

An example of such position sensor device is shown in FIG. 4(d).Preferably in this case, the position sensor device does not compriseintegrated magnetic concentrators. It is an advantage of theseembodiments that diagnostic functionality is provided without increasingthe number of sensor elements.

According to a second aspect, the present invention also provides amagnetic position sensor system comprising: a magnetic source forgenerating a magnetic field having at least two poles; and a positionsensor device according to the first aspect, movable relative to saidmagnetic source, or vice versa.

In an embodiment, the magnetic source is a permanent magnet, rotatableabout a rotation axis; and the position sensor device is mounted at anonzero radial distance and is oriented such that the first direction istangential to an imaginary circle having a centre on the rotation axis.

Such a position sensor system is commonly referred to as “angularposition sensor system”.

The magnet may be an axially or diametrically or radially magnetisedring magnet or disk magnet, more in particular, an axially ordiametrically two-pole ring or disk magnet, or an axially or radiallymagnetized ring or disk magnet having more than two poles, for exampleat least four poles or at least six poles, or at least eight poles.

In an embodiment, the magnetic source is an elongated structurecomprising a plurality of alternating magnetic poles extending in alongitudinal direction; and the position sensor device is movable in thelongitudinal direction, at a nonzero distance from the magnetic source.

Preferably the distance is substantially constant. Preferably the sensordevice is oriented with its first direction (X) parallel to thelongitudinal direction of the magnetic source.

Such a position sensor system is commonly referred to as “linearposition sensor system”. Preferably, in this case, the position sensordevice is further configured for converting at least the first angle θ1into a first linear position, in manners known per se in the art.

In an embodiment, the magnetic position sensor system further comprisesa second processor (e.g. ECU) communicatively connected to the positionsensor device, and configured for performing one of the following: i)receiving the first angle, the first sum and the second sum, anddetermining the second angle based on a ratio of the first sum and thesecond sum, and comparing the first and the second angle to detect anerror; ii) receiving the first and the second angle, and comparing thefirst and the second angle to detect an error; iii) receiving the firstangle and a diagnostic signal indicative of an error.

In this embodiment, the first processor and the second processor maycooperate to detect if an error has occurred, and/or to take appropriateaction at system level. By performing certain functions on two differentprocessors, the probability of detection an error may be furtherincreased.

According to a third aspect, the present invention also provides amethod of determining a position of a position sensor device relative toa magnetic source, comprising the steps of: a) determining a firstmagnetic field component and a second magnetic field component at afirst sensor location, the first magnetic field component being orientedin a first direction, the second magnetic field component being orientedin a second direction perpendicular to the first direction; b)determining a third magnetic field component and a fourth magnetic fieldcomponent at a second sensor location spaced from the first sensorlocation, the third magnetic field component oriented in the firstdirection, the fourth magnetic field component oriented in the seconddirection; c) determining a first difference between the first and thethird magnetic field component, and determining a second differencebetween the second and the fourth magnetic field component, anddetermining a first angle based on a ratio of the first and seconddifference, and outputting the first angle; d) determining a first sumof the first and the third magnetic field component, and determining asecond sum of the second and the fourth magnetic field component, andoptionally outputting or transmitting the first sum and the second sumto a second processor; e) determining a second angle based on a ratio ofthe first sum and the second sum, and optionally outputting ortransmitting the second angle; f) comparing the first angle and thesecond angle, and optionally outputting a diagnostic signal based on aresult of the comparison.

These steps are performed by the angular position sensor system, some orall of which may be performed by the processing unit inside the positionsensor device. More specifically, steps e) and f) may be performed by asecond processor, communicatively connected to, but physically externalto the position sensor device itself.

In an embodiment, the system further comprises a second processorconnected to the position sensor device, and the method furthercomprising the steps of: receiving by the second processor the firstangle; and performing one of the following: i) receiving the first angleand receiving the first sum and the second sum, and determining thesecond angle based on a ratio of the first sum and the second sum, andcomparing the first and second angle to detect an error; ii) receivingthe first angle, and receiving the second angle, and comparing the firstand second angle to detect an error; iii) receiving the first angle andreceiving a diagnostic signal indicative of an error.

As mentioned in the claim, these steps may be performed by the secondprocessor, e.g. by an ECU, external to the magnetic sensor device.

In an embodiment, the step of comparing the first and second anglecomprises: testing if a difference between the first and second angle isa value in a predefined range.

The predefined range may be the range of [90°±ε], or the range of[−90°±ε].

The value of F can be chosen dependent on the maximum allowed externalmagnetic field, but is typically a value smaller than 10°, or smallerthan 5°, or smaller than 2.0°, or smaller than 1.0°, or smaller than0.5°.

Particular and preferred aspects of the invention are set out in theaccompanying independent and dependent claims. Features from thedependent claims may be combined with features of the independent claimsand with features of other dependent claims as appropriate and notmerely as explicitly set out in the claims.

These and other aspects of the invention will be apparent from andelucidated with reference to the embodiment(s) described hereinafter.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic block-diagram of a sensor structure as may be usedin embodiments of the present invention. The sensor structure comprisesa first sensor at a first location X1, and a second sensor at a secondlocation X2 along an X-axis, each sensor comprising an integratedmagnetic concentrator (IMC) and a pair of two horizontal Hall elementsarranged on opposite sides of the IMC.

FIG. 2 is a schematic block-diagram of a sensor structure which is avariant of FIG. 1 .

FIG. 3(a) and FIG. 3(b) show a first example of an angular magneticposition sensor system proposed by the present invention, in front viewand in top view respectively.

FIG. 3(c) to FIG. 3(e) are schematic block diagrams of sensor structureswhich may be used in the sensor device of FIG. 3(b).

FIG. 3(f) is a table showing formulas which may be used by the sensordevice of FIG. 3(b).

FIG. 4(a) and FIG. 4(b) show a second example of an angular magneticposition sensor system proposed by the present invention, in front viewand in top view respectively.

FIG. 4(c) and FIG. 4(d) are schematic block diagrams of sensorstructures which may be used in the sensor device of FIG. 4(b).

FIG. 4(e) is a table showing formulas which may be used by the sensordevice of FIG. 4(b).

FIG. 5(a) to FIG. 5(c) show a third example of an angular magneticposition sensor system proposed by the present invention, in front view,in top view and in side-view respectively.

FIG. 5(d) to FIG. 5(f) are schematic block diagrams of sensor structureswhich may be used in the sensor device of FIG. 5(b).

FIG. 5(g) is a table showing formulas which may be used by the sensordevice of FIG. 5(b).

FIG. 6 shows a flow chart of a method of determining two angles, andgenerating a diagnostic signal, proposed by the present invention. Someor all of the steps may be performed by a position sensor device asillustrated in FIG. 3(b) to FIG. 5(b); or some steps may be performed bya second processor connected to the position sensor device.

FIG. 7 to FIG. 9 show specific examples of the method of FIG. 6 ,illustrating steps which may be performed by a position sensor device ofa position sensor system according to the present invention.

FIG. 10 to FIG. 12 show electrical block-diagrams of circuits that maybe used in position sensor devices described above.

FIG. 13(a) to FIG. 13(c) shows several circuit topologies which may beused to readout and optionally process the signals provided by two setsof magnetic sensor elements, as may be used in embodiments of thepresent invention.

The drawings are only schematic and are non-limiting. In the drawings,the size of some of the elements may be exaggerated and not drawn onscale for illustrative purposes. Any reference signs in the claims shallnot be construed as limiting the scope. In the different drawings, thesame reference signs refer to the same or analogous elements.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

The present invention will be described with respect to particularembodiments and with reference to certain drawings, but the invention isnot limited thereto but only by the claims.

The terms first, second and the like in the description and in theclaims, are used for distinguishing between similar elements and notnecessarily for describing a sequence, either temporally, spatially, inranking or in any other manner. It is to be understood that the terms soused are interchangeable under appropriate circumstances and that theembodiments of the invention described herein are capable of operationin other sequences than described or illustrated herein.

The terms top, under and the like in the description and the claims areused for descriptive purposes and not necessarily for describingrelative positions. It is to be understood that the terms so used areinterchangeable under appropriate circumstances and that the embodimentsof the invention described herein are capable of operation in otherorientations than described or illustrated herein.

It is to be noticed that the term “comprising”, used in the claims,should not be interpreted as being restricted to the means listedthereafter; it does not exclude other elements or steps. It is thus tobe interpreted as specifying the presence of the stated features,integers, steps or components as referred to, but does not preclude thepresence or addition of one or more other features, integers, steps orcomponents, or groups thereof. Thus, the scope of the expression “adevice comprising means A and B” should not be limited to devicesconsisting only of components A and B. It means that with respect to thepresent invention, the only relevant components of the device are A andB.

Reference throughout this specification to “one embodiment” or “anembodiment” means that a particular feature, structure or characteristicdescribed in connection with the embodiment is included in at least oneembodiment of the present invention. Thus, appearances of the phrases“in one embodiment” or “in an embodiment” in various places throughoutthis specification are not necessarily all referring to the sameembodiment but may. Furthermore, the particular features, structures orcharacteristics may be combined in any suitable manner, as would beapparent to one of ordinary skill in the art from this disclosure, inone or more embodiments.

Similarly, it should be appreciated that in the description of exemplaryembodiments of the invention, various features of the invention aresometimes grouped together in a single embodiment, figure, ordescription thereof for the purpose of streamlining the disclosure andaiding in the understanding of one or more of the various inventiveaspects. This method of disclosure, however, is not to be interpreted asreflecting an intention that the claimed invention requires morefeatures than are expressly recited in each claim. Rather, as thefollowing claims reflect, inventive aspects lie in less than allfeatures of a single foregoing disclosed embodiment. Thus, the claimsfollowing the detailed description are hereby expressly incorporatedinto this detailed description, with each claim standing on its own as aseparate embodiment of this invention.

Furthermore, while some embodiments described herein include some, butnot other features included in other embodiments, combinations offeatures of different embodiments are meant to be within the scope ofthe invention, and form different embodiments, as would be understood bythose in the art. For example, in the following claims, any of theclaimed embodiments can be used in any combination.

In the description provided herein, numerous specific details are setforth. However, it is understood that embodiments of the invention maybe practiced without these specific details. In other instances,well-known methods, structures and techniques have not been shown indetail in order not to obscure an understanding of this description.

In this document, unless explicitly mentioned otherwise, the term“magnetic sensor device” or “sensor device” refers to a devicecomprising at least one “magnetic sensor” or at least one magnetic“sensor element”, preferably integrated in a semiconductor substrate.The sensor device may be comprised in a package, also called “chip”,although that is not absolutely required. The sensor device preferablycontains a semiconductor substrate.

In this document, the term “sensor element” or “magnetic sensor element”or “magnetic sensor” can refer to a component or a group of componentsor a sub-circuit or a structure capable of measuring a magneticquantity, such as for example a magneto-resistive element, a GMRelement, an XMR element, a horizontal Hall plate, a vertical Hall plate,a Wheatstone-bridge containing at least one (but preferably four)magneto-resistive elements, etc. or combinations hereof.

In certain embodiments of the present invention, the term “magneticsensor” or “magnetic sensor structure” may refer to an arrangementcomprising one or more integrated magnetic concentrators (IMC), alsoknown as integrated flux concentrators, and one or more horizontal Hallelements arranged near the periphery of the IMC, for example a diskshaped IMC with two horizontal Hall elements 1800 spaced from each other(e.g. as illustrated in FIG. 1 ), or an IMC with four horizontal Hallelements 900 spaced from each other (e.g. as illustrated in FIG. 2 ).

In this document, the expression “in-plane component of a magnetic fieldvector” and “projection of the magnetic field vector in the sensorplane” mean the same. If the sensor device is or comprises asemiconductor substrate, this also means “magnetic field componentsparallel to the semiconductor plane”.

In this document, the expression “out-of-plane component of a vector”and “Z component of the vector” and “projection of the vector on an axisperpendicular to the sensor plane” mean the same.

Embodiments of the present invention are typically described using anorthogonal coordinate system which is fixed to the sensor device, andhaving three axes X, Y, Z, where the X and Y axis are parallel to thesubstrate, and the Z-axis is perpendicular to the substrate.Furthermore, the X-axis is preferably oriented “parallel to thedirection of relative movement” in case of a linear position sensor”, or“tangential to the movement trajectory” in case of a curved movementtrajectory, or in a “circumferential direction”, i.e. tangential to animaginary circle having a centre located on the rotation axis in case ofan angular position sensor system comprising a rotatable magnet. In caseof an angular position sensor system, one of the other axes (Y or Z) ispreferably oriented parallel to the rotation axis of the magnet. Forexample, in FIG. 3(a) and FIG. 4(a) the Z-axis is parallel to therotation axis of the magnet, while in FIG. 5(a) the Y-axis is parallelto the rotation axis.

In this document, the expression “spatial derivative” or “derivative” or“spatial gradient” or “gradient” are used as synonyms. In the context ofthe present invention, the gradient is typically determined as adifference between two values measured at two locations spaced apart inthe X-direction. In theory the gradient is calculated as the differencebetween two values divided by the distance “dx” between the sensorlocations, but in practice the division by “dx” is often omitted,because the measured signals need to be scaled anyway. Hence, in thecontext of the present invention, the magnetic field difference (ΔBx)and magnetic field gradient dBx/dx are used interchangeably.

In this document, the term “magnitude of a magnetic field component By”means “the maximum of the absolute value of the By-signal over a full360° rotation”, and likewise for Bx and Bz.

In this application, horizontal Hall plates are typically referred to byH1, H2, etc., signals from these horizontal Hall plates are typicallyreferred to by h1, h2, etc.; vertical Hall plates are typically referredto by V1, V2, etc.; and signals from these vertical Hall plates aretypically referred to by v1, v2, etc.

In the context of the present invention, the formulas arctan(x/y), a tan2(x,y), arccot(y/x) are considered to be equivalent.

The present invention is related in general to linear or angularmagnetic position sensor systems, comprising a sensor device and amagnetic source, e.g. a permanent magnet, e.g. an axially ordiametrically or radially magnetized ring or disk magnet, e.g. anaxially or diametrically magnetized two-pole ring or disk magnet, or anaxially or radially magnetized ring or disk magnet having more than twopoles, e.g. at least four poles or at least six poles or at least eightpoles. The present invention is also related to linear position sensorsystems comprising a sensor device and a magnetic source in the form ofan elongated magnetic structure comprising a plurality of alternatingpoles. More specifically, the present invention is related to magneticsensor methods and systems which are robust against an externaldisturbance field, and which have error detection capabilities.

Referring to the Figures.

FIG. 1 shows a sensor structure comprising a first sensor S1 located ata first location X1 on an X-axis, and a second sensor S2 located at asecond location X2 on said X-axis, spaced from X1. Each of the first andsecond sensor S1, S2 comprises a disk shaped integrated magneticconcentrator (IMC) and two horizontal Hall elements arranged on theX-axis, on opposite sides of the IMC. The first sensor S1 comprises afirst horizontal Hall element H1 configured for providing a first signalh1, and a second horizontal Hall element H2 configured for providing asecond signal h2. The second sensor S2 comprises a third horizontal Hallelement H3 configured for providing a third signal h3, and a fourthhorizontal Hall element H4 configured for providing a fourth signal h4.

In order to understand the present invention, it suffices to know thatthe signals h1 and h2 of the first sensor S1 can be combined todetermine both an in-plane magnetic field component Bx1 (parallel to thesensor substrate) and an out-of-plane magnetic field component Bz1(perpendicular to the sensor substrate). More in particular, thein-plane magnetic field component Bx1 can be calculated by a subtractionof the signals, and the out-of-plane magnetic field component Bz1 can becalculated by a summation of the signals. This can be expressedmathematically as follows:

Bx1=(h2−h1)  [1]

Bz1=(h2+h1)  [2]

Likewise, the in-plane magnetic field component Bx2, and theout-of-plane magnetic field component Bz2 at the second sensor locationX2 can be determined, e.g. in accordance with the following formulas:

Bx2=(h4−h3)  [3]

Bz2=(h4+h3)  [4]

And from these values an in-plane magnetic field gradient ΔBx and anout-of-plane magnetic field gradient ΔBz can be determined, e.g. inaccordance with the following formulas:

ΔBx=Bx2−Bx1  [5]

ΔBz=Bz2−Bz1  [6]

The value ΔBx can also be referred to as dBx/dx, and the value ΔBz canalso be referred to as dBz/dx. As mentioned above, the scaling factor“dx” is typically omitted, because it is constant, and the values needto be scaled anyway. For this reason, in this application the terms“magnetic field gradient” and “magnetic field difference” mean the same.

It is known that the gradient signals ΔBx, ΔBz are highly insensitive toan external disturbance field.

It is noted that a sensor device (not shown in FIG. 1 , but see e.g.FIG. 3(e) and FIG. 5(f)) having two sensor structures, spaced apart by adistance ΔX, wherein each sensor structure comprises one horizontal Hallelement and one vertical Hall element (with its axis of maximumsensitivity oriented in the X-direction), is also capable of measuringBx1, Bx2, Bz1, Bz2.

FIG. 2 shows a sensor structure comprising two sensors S1, S2, eachhaving an IMC-structure and four horizontal Hall elements, as can beused in embodiments of the present invention. This sensor structure is avariant of the sensor structure of FIG. 1 , the main difference beingthat each sensor comprises four horizontal Hall elements arranged near aperiphery of the integrated magnetic concentrator IMC, instead of onlytwo. The four Hall elements are spaced apart by multiples of 90°. Two ofthe Hall elements of each sensor are located on the X-axis, the othertwo elements are located on the Y-axis perpendicular to the X-axis.

This sensor structure is furthermore capable of measuring a magneticfield component By1 at the first sensor location X1, and measuring By2at the second sensor location X2, both oriented in the Y direction,perpendicular to the X and Z direction. The value of By1 and By2 can becalculated in accordance with the following formulas:

By1=(h3−h4)  [7]

By2=(h7−h8)  [8]

And from these values another in-plane magnetic field gradient ΔBy alongthe X-axis, sometimes also denoted as “dBy/dx” can be determined, e.g.in accordance with the following formula:

ΔBy=By2−By1  [9]

It is noted that a sensor device (not shown in FIG. 2 , but see e.g.FIG. 4(d)) having two sensor structures, spaced apart by a distance ΔX,wherein each sensor structure comprises two vertical Hall elements (onewith its axis of maximum sensitivity oriented in the X-direction, andone with its axis of maximum sensitivity oriented in the Y direction),is also capable of measuring Bx1, By1 at the first sensor location andBx2, By2 at the second sensor location, and thus capable of determiningthe magnetic field gradients ΔBx, ΔBy.

FIG. 3(a) and FIG. 3(b) show an angular magnetic position sensor system300, in front view and in top view respectively. The system 300comprises a cylindrical magnet 301 and a sensor device 302. The magnetmay be an axially or diametrically magnetised two-pole ring magnet ordisk magnet, or an axially or radially magnetized multi-pole ring magnetor disk magnet having at least four or at least six or at least eightpoles. In the example shown, the magnet is rotatable about a rotationaxis A. The sensor device is mounted in an “off-axis” position relativeto the magnet. The sensor device comprises two sensors which are locatedat a radial distance Rs from the rotation axis A, and at an axialdistance “g” from the magnet.

The magnet may have a diameter of 4.0 to 20 mm, e.g. about 10 or about12 mm. The radial distance Rs may be 30% to 70%, or 40% to 60% of anouter radius Ro of the magnet. The axial distance “g” may be 0.5 to 5.0mm, e.g. about 2.0 mm, but the present invention is not limited theretoand other values may also be used

FIG. 3(c) to FIG. 3(e) are schematic block diagrams of sensor structureswhich may be used in the sensor device 302 of FIG. 3(b). The sensorstructure of FIG. 3(c) is illustrated in FIG. 1 . The sensor structureof FIG. 3(d) is illustrated in FIG. 2 . The sensor structure of FIG.3(e) is described above as an alternative for the sensor structure ofFIG. 1 . It is pointed however that the present invention is not limitedto these sensor structures, and other sensor structures may also beused, for example a sensor structure comprising two sensors, each sensorcomprising a horizontal Hall element and at least one magneto-resistive(MR) element.

The first and the second sensor may be spaced apart by a distance “dx”in the range from 1.0 to 3.0 mm, or from 1.5 to 2.5 mm, e.g. equal toabout 1.8 mm, or about 2.0 mm, or about 2.2 mm.

FIG. 3(f) is a table showing formulas which may be used by the sensordevice of FIG. 3(b).

It is known that the angular position 0 of the sensor device 302relative to the magnet 301 can be determined as an arctangent of theratio of ΔBx and ΔBz, in accordance with the following formula: 0=a tan2(ΔBx,ΔBz), and that this value is highly insensitive to an externaldisturbance field. The sensor device 302 may be configured for providingthis value as a first angle value:

θ1=a tan 2(ΔBx,ΔBz)  [10]

However, this angle value alone does not allow to detect an error, e.g.to detect if one of the sensor elements is defective, and/or if itsbiasing is defective, and/or if its readout circuit is defective.

Desiring to provide an angular sensor system which is capable ofmeasuring the angular position in a manner which is highly insensitiveto an external disturbance field, but which is furthermore also capableof detecting an error, the inventors came to the idea of calculating afirst sum of the Bx values, and a second sum of the Bz values, anddetermining a second angle θ2 based on the ratio of the first sum andthe second sum, e.g. in accordance with the following formulas:

ΣBx=(Bx1+Bx2)  [11]

ΣBz=(Bz1+Bz2)  [12]

θ2=a tan 2(ΣBx,ΣBz)  [13]

It is counter-intuitive to use a value (the sum) which is sensitive toan external disturbance field for assessing correct functioning of asensor device that has to be highly insensitive to an externaldisturbance field. It is also noted that the first angle θ1 and thesecond angle θ2 are not the same, hence it is not trivial to use thissecond angle θ2 to check an error of the first angle θ1.

Despite these hurdles, experiments were conducted, and it turned outthat:

-   -   i) the angle values θ1 and θ2 differ approximately by 90° if all        sensor elements are functioning correctly, in the absence of an        external disturbance field;    -   ii) the angle values θ1 and θ2 differ by a value in the range of        [90°±ε], where ε is smaller than 10°, or smaller than 5°, or        smaller than 2°, or smaller than 1.0°, or smaller than 0.5°, if        all sensor elements are functioning correctly, in the presence        of moderate or a relatively weak external disturbance field;    -   iii) the angle values θ1 and θ2 differ by a value outside the        range [90°±τ], where τ is smaller than 10°, or smaller than 5°,        or smaller than 2°, or smaller than 1.0°, or smaller than 0.5°,        if one of the sensor elements is defective, irrespective of the        external disturbance field.

The tolerance margin(s) may be chosen dependent on the envisionedamplitude of the external disturbance field. It is noted that thetolerance margin T may be equal to, or larger than the tolerance marginF. In case r is chosen to be larger than F, the sensor device may outputa warning, which could mean a defect or an unusually high externaldisturbance field, or a glitch.

Taking into account that in practice the angular sensor system istypically designed (magnetic field strength of the magnet, distance fromthe magnet) such that the magnitude of the external disturbance fieldtypically has an amplitude smaller than 10% of the magnetic fieldcomponent induced by the magnet, these experiments show that it ispossible to detect an error by comparing the first and second angle,even in the presence of a moderate external disturbance field. This isone of the underlying principles of the present invention.

Referring back to FIG. 3(f), it can now be understood that the formulasof “Example1” and the sensor structure of FIG. 3(c) can be used tocalculate two angle values θ1 and θ2, one of which (namely θ1) is highlyinsensitive to an external disturbance field, the other (namely θ2)being dependent on an external disturbance field, but as explainedabove, surprisingly found to be sufficiently accurate to detect anerror, e.g. to detect if one of the sensor elements is defective. It isan advantage of this embodiment that no physical sensor elements neededto be added, but that diagnostic information can be obtained byprocessing the signals obtained from the already existing sensorelements in a different manner.

Similarly, the formulas of FIG. 3(f) “Example3” and the sensor structureof FIG. 3(e) can be used to calculate two angular values θ1 and θ2, andto detect an error, e.g. to detect if one of the sensor elements isdefective.

Similarly, the formulas of FIG. 3(f) “Example2” and the sensor structureof FIG. 3(d) can be used to calculate two angular values θ1 and θ2, andto detect an error, e.g. to detect if one of the sensor elements isdefective, but as compared to the sensor structure of FIG. 3(c), fourphysical sensor elements are added for redundancy purposes, namely: H3,H4, H7, H8 of FIG. 3(d).

It is noted that, while it is possible to compute both angles θ1 and θ2inside the sensor device 302, and to compare these values inside thesensor device 302, and to provide a diagnostic signal indicative of anerror, that is not absolutely required for the invention to work.Indeed, in some embodiments of the present invention the sensor device302 is configured for calculating and providing the two angles θ1 andθ2, but the comparison is performed outside of the sensor device 302,for example in another processing unit, e.g. in an Electronic ControlUnit (ECU) connected to the sensor device 302 (see e.g. FIG. 10 to FIG.12 ). In some embodiments of the present invention, the sensor device302 provides the first angle θ1, and the first sum ΣBx and the secondsum ΣBz, and the second angle θ2 may be calculated outside of the sensordevice 302, and the comparison of the first and second angle may beperformed outside of the sensor device 302. This will be discussed inmore detail further.

In a variant of FIG. 3(a) and FIG. 3(b), the sensor device 302 is notarranged at a radial distance Rs substantially equal to Rs=Ro/2 (in caseof a disk magnet) or Rs=(Ri+Ro)/2 in case of a ring magnet, (Ri beingthe inner radius, Ro being the outer radius), but is positioned at aradial distance Rs closer to the rotation axis, or further away from therotation axis. In this case, the first and second angle may becalculated in accordance with the following formulas:

θ1=a tan 2(L*ΔBx,ΔBz)  [10b]

θ2=a tan 2(M*ΣBx,ΣBz)  [13b]

where L and M are predefined constants, which may be determined duringdesign or simulation, or determined during calibration and stored in anon-volatile memory of the sensor device.

FIG. 4(a) and FIG. 4(b) show another angular magnetic position sensorsystem 400, in front view and in top view respectively, comprising amagnet 401 and a sensor device 402. Again, the magnet is movablerelative to the sensor device, or vice versa. The sensor system 400 canbe seen as a variant of the sensor system 300 of FIG. 3(a), and most ofwhat has been described above is also applicable here, mutatis mutandis.The main differences are:

-   -   i) the sensor device 402 is located at a radial distance Rs        larger than the outer radius Ro of the magnet, and at an axial        position between the bottom surface and the top surface,        preferably substantially halfway the height of the magnet 401;    -   ii) the sensor device 402 is configured for measuring two        in-plane gradients ΔBx and ΔBy, and to calculate the first angle        θ1 in accordance with the following formula:

θ1=a tan 2(ΔBx,ΔBy)  [14]

-   -   iii) the sensor device 402 is configured for measuring a first        sum ΣBx and a second sum ΣBy, e.g. in accordance with the        following formulas:

ΣBx=(Bx1+Bx2)  [15]

ΣBy=(By1+By2)  [16]

θ2=a tan 2(ΣBx,ΣBy)  [17]

FIG. 4(c) and FIG. 4(d) are schematic block diagrams of sensorstructures which may be used in the sensor device 402. The sensorstructure of FIG. 4(c) is illustrated in FIG. 2 . The sensor structureof FIG. 4(d) comprises two sensors, each having two vertical Hallplates, one oriented with its axis of maximum sensitivity in theY-direction, one with its axis of maximum sensitivity in theX-direction. It is pointed out that other sensor structures capable ofmeasuring Bx and By can also be used, for example sensor structurescomprising magneto-resistive (MR) elements, e.g. GMR elements or XMRelements.

FIG. 4(e) is a table showing formulas which may be used by the sensordevice 402. More in particular, the formulas of “Example1” can be usedin combination with the sensor structure of FIG. 4(c), and the formulasof “Example2” can be used in combination with the sensor structure ofFIG. 4(d), in order to calculate two angular values θ1 and θ2, and todetect an error, e.g. to detect if one of the sensor elements isdefective, based on an angular difference between the angles θ1 and θ2,e.g. by testing if the value (θ1-θ2) falls inside the range (90°±ε)and/or outside the range (90°±τ), where ε and τ are predefined thresholdvalues. As mentioned above, ε and τ may be equal, or may be different.

As mentioned above, it is possible to calculate both angles θ1 and θ2inside or outside the sensor device 402, and/or to compare the values θ1and θ2 inside or outside the sensor device 402.

In FIG. 4(a) and FIG. 4(b), the sensor device is located at an axialposition substantially halfway the bottom and top surface of thecylindrical magnet 401, but the invention will also work if the magnetis axially shifted upwards or downwards. In this case, the followingformulas may be used:

θ1=a tan 2(L*ΔBx,ΔBy)  [14b]

θ2=a tan 2(M*ΣBx,ΣBy)  [17b]

where L and M are predefined constants, which may be determined duringdesign or simulation, or determined during calibration and stored in anon-volatile memory of the sensor device.

FIG. 5(a) to FIG. 5(c) show an angular magnetic position sensor system500, in front view, in top view and in side-view respectively,comprising a magnet 501 and a sensor device 502. The sensor system 500can be seen as a variant of the sensor system 300 of FIG. 3(a), or as avariant of the sensor system 400 of FIG. 4(a), wherein the sensor deviceis rotated by 90° about the X-axis. Most of what has been describedabove is also applicable here, mutatis mutandis.

FIG. 5(d) to FIG. 5(f) are schematic block diagrams of sensor structureswhich may be used in the sensor device 502. The same sensor structuresas shown in FIG. 3(c) to FIG. 3(e) can be used.

FIG. 5(g) is a table showing formulas which may be used by the sensordevice of FIG. 5(b). The same formulas as shown in FIG. 3(f) can beused.

While not explicitly shown, the principles described above also work forlinear position sensor systems. In this case the magnet is preferably anelongated structure with a plurality of alternating magnetic poles, andthe sensor device would be further configured for converting the angularposition value θ1 into a linear position value X, in known manners. Thesensor elements may be arranged substantially in a symmetry plane of themagnetic structure extending in the elongated direction.

FIG. 6 shows a flow chart of a method 600 of determining two angles θ1and θ2, and for detecting an error, e.g. by generating a diagnosticsignal (e.g. a validity signal or an error signal). The method 600comprises the following steps:

-   -   a) determining 601 a first magnetic field component (e.g. Bx1)        and a second magnetic field component (e.g. By1 or Bz1) at a        first sensor location (e.g. X1), the first magnetic field        component being oriented in a first direction (e.g. X,        tangential to the direction of relative movement), the second        magnetic field component (e.g. By1 or Bz1) being oriented in a        second direction (e.g. Y or Z) perpendicular to the first        direction;    -   b) determining 602 a third magnetic field component (e.g. Bx2)        and a fourth magnetic field component (e.g. By2 or Bz2) at a        second sensor location (e.g. X2) spaced (e.g. by a distance ΔX)        from the first sensor location (e.g. X1), the third magnetic        field component (e.g. Bx2) oriented in the first direction (e.g.        X), the fourth magnetic field component (e.g. By2 or Bz2)        oriented in the second direction (e.g. Y or Z);    -   c) determining 603 a first difference (e.g. ΔBx) between the        first (e.g. Bx1) and the third (e.g. Bx2) magnetic field        component, and determining a second difference (e.g. ΔBy or ΔBz)        between the second (e.g. By1 or Bz1) and the fourth (e.g. By2 or        Bz2) magnetic field component, and determining a first angle        (θ1) based on a ratio of the first and second difference, and        outputting the first angle (θ1);    -   d) determining 604 a first sum (e.g. ΣBx) of the first (e.g.        Bx1) and the third (e.g. Bx2) magnetic field component, and        determining a second sum (e.g. ΣBy or ΣBz) of the second (e.g.        By1 or Bz1) and the fourth (e.g. By2 or Bz2) magnetic field        component, and optionally outputting or transmitting the first        sum (e.g. ΣBx) and the second sum (e.g. ΣBy or ΣBz);    -   e) determining 605 a second angle (θ2) based on a ratio of the        first sum (e.g. ΣBx) and the second sum (e.g. ΣBy or ΣBz), and        optionally outputting or transmitting the second angle (θ2);    -   f) comparing 606 the first angle (θ1) and the second angle (θ2),        and detecting an error based on a result of the comparison, and        optionally outputting or transmitting a corresponding diagnostic        signal.

The method may comprise a further step, such as providing an acousticsignal (e.g. an audible sound) or a visible signal (e.g. a light signal)in case an error is detected. If the sensor device is connected to anECU, the ECU may take appropriate action, in manners known per se in theart.

The method steps 601 to 606 may be performed solely by the positionsensor device, or partly by the position sensor device and partly by asecond processor, e.g. an electronic control unit (ECU) communicativelyconnected to the position sensor device. Three examples are described:

In an embodiment, all of the steps a) to f) are performed by theposition sensor device itself. In this case, the first and second sum donot need to be output in step d), the second angle does not have to beoutput in step e), but a diagnostic signal has to be output in step f).In this embodiment, no steps need to be performed outside of theposition sensor device, in order to detect if an error has occurred.Such a method 700 is illustrated in FIG. 7 , which is a subset of FIG. 6.

In an embodiment, the position sensor system comprises said secondprocessor (e.g. an ECU), and this second controller is configured forreceiving the first and the second angle, and for comparing them in stepf). In this embodiment, the position sensor device does not have toperform step f) and does not have to output the first and second sum instep d), but has to output the second angle in step e) for allowing thesecond processor to perform the comparison. Such a method 800 isillustrated in FIG. 8 , which is another subset of FIG. 6 .

In an embodiment, the position sensor system comprises said secondprocessor (e.g. an ECU), and this second controller is configured forreceiving the first sum and the second sum in step d), and forcalculating the second angle in step e), and for comparing the first andsecond angle in step f) in order to detect whether an error hasoccurred. In this embodiment, the position sensor device does not haveto perform steps e) and f), but has to output the first and second sumin step d) for allowing the second processor to compute the secondangle. Such a method 900 is illustrated in FIG. 9 , which is anothersubset of FIG. 6 .

FIG. 10 to FIG. 12 show electrical block-diagrams of circuits that maybe used in position sensor devices described above.

FIG. 10 shows an electrical block-diagram of a circuit 1010 that may beused in position sensor devices described above. The circuit 1010comprises a plurality of magnetic sensors elements H1 to H4, and aprocessing unit 1030, and a non-volatile memory 1031. This block-diagrammay be used for example in sensor devices having a sensor structurecapable of determining a magnetic field gradient dBx/dx and a magneticfield gradient dBz/dx, for example as illustrated in FIG. 1 or FIG. 3(c)or FIG. 3(e) or FIG. 4(d) or FIG. 5(d) or FIG. 5(f). The sensor elementsmay be Hall elements, e.g. vertical Hall elements and/or horizontal Hallelements, MR elements, etc.

The processing unit 1030 may be configured for performing any of themethods shown in FIG. 6 to FIG. 9 . The sensor device 1010 may beconnected to a second processor 1040, for example to an electroniccontrol unit 1040 (ECU), by means of one or more wires, or wireless(e.g. via a radio frequency link RF, or an infra-red link IR). Dependingon which method is implemented, the sensor device 1010 may output one ormore of the following values: a first angle θ1, a second angle θ2, afirst sum ΣBx, a second sum ΣBy or ΣBz, and a diagnostic signal “diag”;and the second processor 1040, if present, may be configured forreceiving one or more of these values, and may be configured forcalculating the second angle θ2 and/or for comparing the two angles, asdescribed above.

The first angle θ1 may be determined in manners described above, forexample by using some of the mathematical formulas [1] to [17b]described above, or using a look-up table, optionally withinterpolation. As explained above, the first angle θ1 is based on aratio of difference signals. The subtraction may be performed in theanalog domain before or after amplification, or in the digital domain.

The processing unit 1030 may comprise a digital processor, which mayoptionally comprise or be connected to a non-volatile memory 1031. Thismemory may be configured for storing one or more constants, for exampleone or more of the predefined threshold values ε, τ, L, M. The digitalprocessor 1030 may for example be an 8-bit processor, or a 16-bitprocessor.

While not explicitly shown, the circuit 1010 may further comprise one ormore components or sub-circuits selected from the group consisting of: abiasing source (e.g. a current source, a voltage source), an amplifier,a differential amplifier, an analog-to-digital convertor (ADC), etc. TheADC may have a resolution of at least 8 bits, or at least 10 bits, or atleast 12 bits, or at least 14 bits, or at least 16 bits.

FIG. 11 shows an electrical block-diagram of a circuit 1110 that may beused in position sensor devices described above. The circuit 1110 can beconsidered a variant of the circuit of FIG. 10 , and most of what hasbeen described above is also applicable here, mutatis mutandis.

The main difference between the sensor device of FIG. 10 and the sensordevice of FIG. 11 is that the circuit 1110 comprises eight magneticsensor elements H1 to H8 instead of only four, and that other formulasor look-up table(s) may be used to compute the first and second angle.This block-diagram may be used for example in sensor devices having asensor structure as illustrated in FIG. 2 or FIG. 3(d) or FIG. 4(c) orFIG. 5(e).

FIG. 12 shows a variant of the electrical block-diagram of FIG. 11 ,having a first processing unit 1230 and a second processing unit 1232,and having eight sensor elements H1 to H8.

The first processing unit may be configured for determining a firstangle θ1 in the same manner as the circuit of FIG. 10 , for exampleusing the formulas [1] to [6] and [10] to [13], e.g. in accordance withthe formulas of “Example1” in FIG. 3(f).

The second processing unit 1232 may be configured for determining thesecond angle θ2 using the formulas illustrated as “Example2” in FIG.3(f), or using the formulas illustrated as “Example1” of FIG. 4(e). Incase the comparison of the two angles is performed inside the device1210, the first processing unit 1230 may be furthermore configured forproviding the first angle value θ1 to the second processing unit 1232for allowing the comparison.

The first processing unit 1230 receives signals h1, h2, h5, h6 from afirst subset of the eight sensor elements where they are digitized. Thesecond processing unit 1232 receives signals originating from all thesensor elements H1 to H8. The second subset of signals h3, h4, h7, h8are received from the sensor elements H3, H4, H7, H8, but in order todetect whether an error has occurred, the second processing unit 1232also needs the first subset of signals. These may be received directlyfrom the sensor elements, or indirectly via the first processing unit1230, e.g. after digitization into values d1, d2, d5, d6.

FIG. 13(a) to FIG. 13(c) show several circuit topologies which may beused to readout and optionally process the signals provided by thesensor devices described above.

FIG. 13(a) shows a block-diagram of a readout-circuit, comprising amultiplexer MUX, a single analog-to-digital convertor ADC, and a singledigital processor DSP. This block-diagram may be used in the circuit ofFIG. 10 and is primarily aimed at detecting errors related to the Hallelements (transducers) and their biasing and readout circuitry. The mainpurpose of this block-diagram is to illustrate that the signals from allthe sensor elements are processed by a single ADC and a single signalprocessor, e.g. as also illustrated in FIG. 10 and FIG. 11 .

FIG. 13(c) shows a block-diagram of two mainly separatereadout-circuits, each comprising an analog-to-digital convertor ADC,and a dedicated digital processor DSP. The upper sub-circuit isconfigured for digitizing and processing the first set of sensorsignals. The lower sub-circuit is configured for digitizing andprocessing the second set of sensor signals, but the first processor mayprovide data to the second processor. This block-diagram may be used inthe circuit of FIG. 12 , where for example the first processor DSP1 mayprovide the first angle θ1, and a digital representation of the hallsignals h1, h2, h5, h6 in the form of digital values d1, d2, d5, d6 tothe second processor DSP1. The main purpose of this block-diagram is toillustrate that each of the sensor signals is processed by a single ADC.

FIG. 13(b) shows a block-diagram of another solution, which can beconsidered as “intermediate solution”, having a multiplexer and a singleADC and a single digital processor DSP, and a circuit which sends thedigitized values originating from the first set of Hall elements intothe DSP for further processing, but which sends the digitized valuesoriginating from the second set of Hall elements not into the DSP, butto a digital circuit and/or an arithmetic unit capable of calculatingthe above described first sum ΣBx, a second sum ΣBy or ΣBz, and tooutput this data to an external processor, e.g. to an ECU. The mainpurpose of FIG. 13(b) is to show that it is possible to digitize some ofthe sensor values in the ADC, without processing them inside the DSP.

From the examples shown in FIG. 10 to FIG. 13(c), it shall be clear tothe skilled reader that many hardware implementations are possible.

The systems and methods and devices described herein may be very wellsuited for industrial, robotic or automotive applications, where“functional safety” is important.

The formulas [10], [13], [14], [17], and [10b], [13b], [14b], [17b]described above are applicable for a two-pole magnet, but the presentinvention is not limited thereto, and also works for a magnet having atleast four poles or at least six poles, or at least eight poles, etc. inwhich case the arctangent function provides θ/2 or θ/3 or θ/4, etc.,where θ represents the mechanical rotation angle.

In a variant of FIG. 3(a), not shown, the sensor device is rotated by90° over the X-axis, such that its semiconductor substrate is parallelto the rotation axis A. In this case the formulas of FIG. 4(e) may beused, based on the ΔBx, ΔBy, ΣBx, ΔBy rather than ΔBx, ΔBz, ΣBx, ΣBz.

Above, a mechanism is described for detecting an error based on theoutcome of a comparison of a first angle calculated as a first functionof a ratio of two differences, and a second angle calculated as a secondfunction of a ratio of two sums. Optionally additional tests may beperformed for detecting whether an error has occurred. For example, inan embodiment, the processing unit is further configured for determininga third sum (Sum3) as the sum of the square of the first difference(ΔBx) and the square of the second difference (ΔBy; ΔBz), e.g. inaccordance with the following formula:

Sum3=sgr(ΔBx)+sgr(ΔBz)  [18]

and for optionally outputting this third sum; and is further configuredfor determining a fourth sum (Sum4) calculated as the sum of the squareof the first sum (ΣBx) and the square of the second sum (ΣBy; ΣBz), e.g.in accordance with the following formula:

Sum4=sgr(ΣBx)+sgr(Bz)  [19]

and for optionally outputting this fourth sum; and is further configuredfor scaling the fourth sum with a predefined constant K4, which may bedetermined during design, or may be determined during calibration andstored in a non-volatile memory of the sensor device; and is furtherconfigured for determining if the third sum (Sum3) and the scaled fourthsum (Sum4) are substantially the same within a predefined tolerancemargin of at most ±10%, or at most ±5%, for example by calculating aratio R as (Sum3)/(K4*Sum4), and by testing if this is a value in therange from 90% to 100%, or in the range from 95% to 105%. If the ratiofalls within the range, this means that no additional error is detected.If the ratio falls outside the range, it means that an additional erroris detected. Similar as above, the calculations of formula [18] and [19]may be calculated completely inside the sensor device itself, orpartially inside the sensor device itself, and partially by a secondprocessor (e.g. an ECU) connected to the sensor device, but external tothe sensor device. Of course, in this case, one or more intermediatevalues need to be output by the sensor device for allowing thecalculation and/or comparison to be performed outside the sensor device.For example, the third sum Sum3 and the fourth sum Sum4 may be output bythe sensor device, and the scaling with the factor K4 and the comparisonof Sum3 and (K4*Sum4) may be performed by an ECU.

1. A position sensor device comprising: a first sensor configured fordetermining a first magnetic field component and a second magnetic fieldcomponent at a first sensor location, the first magnetic field componentoriented in a first direction, the second magnetic field componentoriented in a second direction perpendicular to the first direction; anda second sensor configured for determining a third magnetic fieldcomponent and a fourth magnetic field component at a second sensorlocation spaced from the first sensor location, the third magnetic fieldcomponent oriented in the first direction, the fourth magnetic fieldcomponent oriented in the second direction; a processing unit connectedto the first sensor and to the second sensor, and configured fordetermining a first difference between the first and the third magneticfield component, and for determining a second difference between thesecond and the fourth magnetic field component, and for determining afirst angle based on a ratio of the first and second difference, and foroutputting the first angle; wherein the processing unit is furtherconfigured for performing one of the following: i) determining a firstsum of the first and the third magnetic field component, and determininga second sum of the second and the fourth magnetic field component, andoutputting the first sum and the second sum for allowing an externalprocessor to determine a second angle and to compare the first andsecond angle in order to detect an error; ii) determining a first sum ofthe first and the third magnetic field component, and determining asecond sum of the second and the fourth magnetic field component, anddetermining a second angle based on a ratio of the first sum and thesecond sum, and outputting the second angle for allowing an externalprocessor to compare the first and second angle in order to detect anerror; iii) determining a first sum of the first and the third magneticfield component and determining a second sum of the second and thefourth magnetic field component and determining a second angle based ona ratio of the first sum and the second sum, and comparing the firstangle and the second angle, and outputting a diagnostic signal based ona result of the comparison.
 2. The position sensor device according toclaim 1, wherein the first sensor comprises a first integrated magneticconcentrator and a first and a second horizontal Hall element arrangedon opposite sides of the first IMC; and wherein the second sensorcomprises a second integrated magnetic concentrator and a third and afourth horizontal Hall element arranged on opposite sides of the secondIMC.
 3. The position sensor device according to claim 2, wherein thefirst sensor further comprises a fifth and a sixth horizontal Hallelement which are 90° spaced from the first and second horizontal Hallelement; and wherein the second sensor further comprises a seventh andan eighth horizontal Hall element which are 90° spaced from the thirdand fourth horizontal Hall element.
 4. The position sensor deviceaccording to claim 1, wherein the first sensor comprises a firsthorizontal Hall element, and a first vertical Hall element; and whereinthe second sensor comprises a second horizontal Hall element, and asecond vertical Hall element
 5. The position sensor device according toclaim 1, wherein the first sensor comprises a first and a secondvertical Hall element; and wherein the second sensor comprises a thirdand a fourth vertical Hall element.
 6. A magnetic position sensor systemcomprising: a magnetic source for generating a magnetic field having atleast two poles; a position sensor device according to claim 1, movablerelative to said magnetic source, or vice versa.
 7. The magneticposition sensor system according to claim 6, wherein the magnetic sourceis a permanent magnet, rotatable about a rotation axis; and wherein theposition sensor device is mounted at a nonzero radial distance and isoriented such that the first direction is tangential to an imaginarycircle having a centre on the rotation axis.
 8. The magnetic positionsensor system according to claim 6, wherein the magnetic source is anelongated structure comprising a plurality of alternating magnetic polesextending in a longitudinal direction; and wherein the position sensordevice is movable in the longitudinal direction, at a nonzero distancefrom the magnetic source.
 9. The magnetic position sensor systemaccording to claim 6, further comprising a second processorcommunicatively connected to the position sensor device, and configuredfor performing one of the following: i) receiving the first angle andreceiving the first sum and the second sum, and determining the secondangle based on a ratio of the first sum and the second sum, andcomparing the first and second angle to detect an error; ii) receivingthe first angle, and receiving the second angle, and comparing the firstand second angle to detect an error; iii) receiving the first angle andreceiving a diagnostic signal indicative of an error.
 10. A method ofdetermining a position of a position sensor device relative to amagnetic source, comprising the steps of: a) determining a firstmagnetic field component and a second magnetic field component at afirst sensor location, the first magnetic field component being orientedin a first direction, the second magnetic field component being orientedin a second direction perpendicular to the first direction; b)determining a third magnetic field component and a fourth magnetic fieldcomponent at a second sensor location spaced from the first sensorlocation, the third magnetic field component oriented in the firstdirection, the fourth magnetic field component oriented in the seconddirection; c) determining a first difference between the first and thethird magnetic field component, and determining a second differencebetween the second and the fourth magnetic field component, anddetermining a first angle based on a ratio of the first and seconddifference, and outputting the first angle; d) determining a first sumof the first and the third magnetic field component, and determining asecond sum of the second and the fourth magnetic field component, andoptionally outputting or transmitting the first sum and the second sumto a second processor; e) determining a second angle based on a ratio ofthe first sum and the second sum, and optionally outputting ortransmitting the second angle; f) comparing the first angle and thesecond angle, and optionally outputting a diagnostic signal based on aresult of the comparison.
 11. The method according to claim 10, whereinthe system further comprises a second processor connected to theposition sensor device, and wherein the method further comprising thesteps of: receiving by the second processor the first angle; and one ofthe following steps: i) receiving the first angle and receiving thefirst sum and the second sum, and determining the second angle based ona ratio of the first sum and the second sum, and comparing the first andsecond angle to detect an error; ii) receiving the first angle, andreceiving the second angle, and comparing the first and second angle todetect an error; iii) receiving the first angle and receiving adiagnostic signal indicative of an error.
 12. The method according toclaim 10, wherein the step of comparing the first and second anglecomprises: testing if the difference between the first and second angleis a value in a predefined range.